/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.db.TagManager;
/*    */ import com.newcrm.exception.DBException;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class DeleteCustomerTagRelation extends AbstractAction
/*    */ {
/* 21 */   private int id = 0;
/*    */ 
/*    */   public DeleteCustomerTagRelation(AbstractHttpServlet servlet) {
/* 24 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public DeleteCustomerTagRelation(AbstractHttpServlet servlet, String id) {
/* 28 */     super(servlet);
/* 29 */     this.id = Util.str2Int(id);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 35 */     int customerId = Util.getURLIntParameter(request
/* 36 */       .getParameter("CustomerId"));
/* 37 */     TagManager manager = new TagManager();
/*    */     try {
/* 39 */       int result = manager.delete(customerId, this.id);
/* 40 */       response.setContentType("text/html;charset=utf-8");
/* 41 */       PrintWriter out = response.getWriter();
/* 42 */       JSONObject jsonObject = new JSONObject();
/* 43 */       jsonObject.put("error", "0");
/* 44 */       jsonObject.put("result", Integer.valueOf(result));
/* 45 */       out.println(jsonObject);
/* 46 */       out.flush();
/* 47 */       out.close();
/*    */     } catch (DBException e) {
/* 49 */       e.printStackTrace();
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.DeleteCustomerTagRelation
 * JD-Core Version:    0.6.1
 */